//app.js
let Axios = require('common/js/ajax.js');
App({
	 data: {
    Config :{
      sdkappid: 1400178898,//
      accountType: 36862,
      accountMode: 0 ,//帐号模式，0-表示独立模式
			UnreadMsgCount:0,
			isNoData: true,			
			contactList: [], //会话列表
    },
  },
	onLaunch: function() {
		var _this = this
		let user = wx.getStorageSync('userInfo') || {}
		if (user.hasOwnProperty('openid')) {
			this.globalData.openid = user.openid;
			if (user.hasOwnProperty('nickName') && user.hasOwnProperty("avatarUrl")) {
				this.globalData.nickName = user.nickName;
				this.globalData.avatarUrl = user.avatarUrl;
				this.globalData.uid = user.uid;
				this.globalData.identifier = user.identifier
				this.globalData.identifierNick = user.identifierNick
				this.globalData.userSig = user.userSig
				wx.reLaunch({
					url: '/pages/indexList/indexList',
				})
			}
		} else {
			wx.reLaunch({
				url: "/pages/indexList/indexList",
			})
		}
		wx.getSystemInfo({
			success: function(res) {
				//model中包含着设备信息
				console.log(res.model)
				var model = res.model
				if (model.search('iPhone X') != -1) {
					_this.globalData.isIpx = true;
				} else {
					_this.globalData.isIpx = false;
				}
			}
		})
	},
	globalData: {
		openid: '1111111',
		nickName: '',
		avatarUrl: '',
		appid: "wx3454f187e39e189e",
		secret: "7a560c7ece36da5be618c2d685f5cb40",
		baseUrl: 'https://test.cnsunrun.com/zhencanghui/',
		uid: '',
		temp: {},
		isIpx: false,
		identifier:'',
		identifierNick:'',
		userSig:'',
		onMsgNotify:''
	}
})
